#!/bin/bash
# vim: fdm=marker fmr=[[[,]]] cms=\ #%s

if [ ! -f $1.c ] 
then
    echo $1.c not exist
    exit
fi
exe=$1

CFLAGS="-g -Wall"
INCL="-I${ENV_DIR}/src/include -I${SOAR}/common/c/include -I${ORACLE_HOME}/precomp/public -I${TUXDIR}/include"
LIBS="-L${ENV_DIR}/lib -lcm -ldbauto -L${SOAR}/common/c/lib -llatop -L${TUXDIR}/lib -lwsc -lbuft -lgpnet -lfml -lfml32 -lengine -L${ORACLE_HOME}/lib -lclntsh -lpthread"

$CC $INCL $CFLAGS -o $exe ${exe}.c $LIBS
if [ $? -eq 0 ]
then
    chmod 755 $exe
    mv -f $exe $BIN
fi
